<?php
/**
 * licenses : MIT
 * creatTime: 2020/5/20
 * author : weblinuxgame
 * filename: NewsSearch.php
 */

namespace App\Models\Search;

use App\Models\News;
use ScoutElastic\Searchable;
use App\Models\EsIndexConfigurator\NewsIndexConfigurator;


/**
 * Class NewsSearch
 * @package App\Models\Search
 */
class NewsSearch extends News
{
    use Searchable;


    protected $searchRules = [
        //
    ];

    protected $indexConfigurator = NewsIndexConfigurator::class;

    // Here you can specify a mapping for model fields
    protected $mapping = [
        'properties' => [
            'title' => [
                'type' => 'text',
                // Also you can configure multi-fields, more details you can find here
                // https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html
                'fields' => [
                    'raw' => [
                        'type' => 'keyword',
                    ]
                ]
            ],
        ]
    ];

}
